import type * as T from './type'
import http from '@/utils/http'

export type * from './type'

/** 获取文件列表 */
export function getFileList(params) {
  return http.get<PageRes<T.FileItem[]>>('/file/getFileList', params)
}

export function uploadFile(data) {
  return http.post<T.FileItem[]>('/file/oss/upload', data,{ headers : {'Content-Type': 'multipart/form-data'}})
}

export function updateFile(data) {
  return http.post<T.FileItem[]>('/file/update', data)
}

export function deleteFile(id) {
  return http.post<T.FileItem[]>(`/file/delete/${id}`,)
}

export function fileDetail(id) {
  return http.get<T.FileItem[]>(`/file/detail/${id}`,)
}


export function fileAddTag(data) {
  return http.post<T.FileItem[]>(`/file/add/tag`, data)
}

export function fileTagList() {
  return http.get(`/file/tag/all/list`)
}

export function fileAddDir(data){
  return http.post<boolean>(`/file/add/dir`,data)
}

export function fileSave(data){
  return http.post<boolean>(`/file/save`,data)
}

export function fileTagPage(params) {
  return http.get(`/file/tag/page`, params)
}

export function fileTagSave(data) {
  return http.post(`/file/tag/save`, data)
}


export function fileTagUpdate(data) {
  return http.post(`/file/tag/update`, data)
}

export function fileTagDelete(data) {
  return http.post(`/file/tag/delete`, data)
}





